<?php
/**
 * Created by PhpStorm.
 * User:tsingStar
 * Date: 2019/7/12
 * Time: 19:06
 */

namespace app\home\controller;


class Category extends Common
{
    protected function _initialize()
    {
        parent::_initialize();
    }

    public function index()
    {
        $this->templateTitle("分类");
        $cate_list = \app\common\model\Category::getCategory();
        foreach ($cate_list as &$p_item){
            $p_item["brand_list"] = \app\common\model\Category::getBrand($p_item["id"]);
            $p_item["child_list"] = \app\common\model\Category::getCategory($p_item["id"]);
        }
        $this->assign("cate_list", $cate_list);
        return $this->fetch("index");
    }

}